package com.nuo.laboratory.juc.threadpoll;

import cn.hutool.core.thread.ThreadFactoryBuilder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.BinaryOperator;
import java.util.function.Function;

/**
 * 线程安全
 *
 * @author LGC
 * @date 2022/3/30 10:50
 */
public class ThreadSafe {
    /**
     * final关键字 修饰 类，方法，变量
     * StringBuilder 线程不安全,  StringBuffer 线程安全
     * 同步容器
     * ArrayList->Vector、Stack、Collections.synchronizedList(List)
     * HashMap-> HashTable、ConcurrentHashMap、 Collections.synchronizedMap(List)
     * 并发容器
     * ArrayList-> CopyOnWriteArrayList
     * HashSet、TreeSet-->CopyOnWriteArraySet、ConcurrentSkipListSet（线程安全）
     * HashMap、TreeMap-->ConcurrentHashMap、ConcurrentSkipListMap（线程安全 ）
     * 线程池  手动创建
     */


    public static void main(String[] args) {

    }
}
